﻿using WebAPI.Util;
using System.ComponentModel.DataAnnotations;
using RapidSalesAdminPortalAPI.DataAccess;

namespace RapidSalesAdminPortalAPI.Models
{
    public class GetProductListRequest : BasePageInput
    {
        public string? MatrixCellAk { get; set; }
        public string? ProductCode { get; set; }
        public string? ProductNameEn { get; set; }
        public string? TicketDescriptionEn { get; set; }
        public decimal? UnitPrice { get; set; }
        public string? EventAk { get; set; }
        public string? EventNameEn { get; set; }
        public string? EventDescriptionEn { get; set; }
        public string? Status { get; set; }
        //public string? RapidSalesSStartDate { get; set; }
        //public string? RapidSalesSEndDate { get; set; }
        //public string? RapidSalesEStartDate { get; set; }
        //public string? RapidSalesEEndDate { get; set; }
        public string? ParentalGuidance { get; set; }
    }

    public class ProductListResponse
    {
        public Guid Id { get; set; }
        public string? MatrixCellAk { get; set; }
        public string? ProductCode { get; set; }
        public string? ProductNameEn { get; set; }
        public string? ProductNameTc { get; set; }
        public string? ProductNameSc { get; set; }

        public string? Thumbnail { get; set; }
        public string? TicketDescriptionEn { get; set; }
        public string? TicketDescriptionTc { get; set; }
        public string? TicketDescriptionSc { get; set; }
        public decimal? UnitPrice { get; set; }
        public string? EventAk { get; set; }
        public string? EventNameEn { get; set; }
        public string? EventNameTc { get; set; }
        public string? EventNameSc { get; set; }
        public string? EventDescriptionEn { get; set; }
        public string? EventDescriptionTc { get; set; }
        public string? EventDescriptionSc { get; set; }
        public bool? Enable { get; set; }
        public string? RapidSalesStartDate { get; set; }
        public string? RapidSalesEndDate { get; set; }
        public bool? ParentalGuidance { get; set; }
        public int? MaxPurchaseQty { get; set; }
        public DateTime? LastUpdateTime { get; set; }
        public List<SalesPointResponse>? SalePointList { get; set; }
    }

    public partial class SalesPointResponse
    {
        public string Code { get; set; } = null!;
        public string NameEn { get; set; } = null!;
        public string NameTc { get; set; } = null!;
        public string NameSc { get; set; } = null!;
        public string DescriptionEn { get; set; } = null!;
        public string DescriptionTc { get; set; } = null!;
        public string DescriptionSc { get; set; } = null!;
        public string OperationAre { get; set; } = null!;
        public bool? Exclusive { get; set; }
        public string? Passcode { get; set; }
        public bool Enable { get; set; }
        public Guid CreateUser { get; set; }
        public DateTime CreateDate { get; set; }
        public Guid UpdateUser { get; set; }
        public DateTime UpdateDate { get; set; }
    }

    public class UpdateFrIpProductRequest
    {
        [Required]
        public Guid Id { get; set; }
        public string? RapidSalesStartDate { get; set; }
        public string? RapidSalesEndDate { get; set; }
        public bool Enable { get; set; }
    }

    public class EnableFrIpProductRequest
    {
        [Required(ErrorMessage = "Ids is required")]
        public string ids { get; set; }

        public bool enable { get; set; }

    }

    public class GetProductListFrontRequest
    {
        /// <summary>
        /// 语言标识
        /// </summary>
        [Required(ErrorMessage = "language is required")]
        public int lang { set; get; }

        //public string? EventAk { get; set; }

        [Required(ErrorMessage = "SalesPoint Code is required")]
        public string SalesPointCode { get; set; }
    }

    public class GetProductListFrontResponse
    {
        public string EventId { get; set; }
        public string EventName { get; set; }
        public string EventDesc { get; set; }

        public List<GetProductListFrontResponse_ProductList> ProductList { get; set; }
        public List<GetProductListFrontResponse_EventTimeSlotsList> TimeSlotsList { get; set; }
    }
    public class GetProductListFrontResponse_ProductList
    {
        public string ProductId { get; set; }
        public string ProductCode { get; set; }
        public string ProductName { get; set; }
        public string TicketDescription { get; set; }
        public string Thumbnail { get; set; }
        public decimal UnitPrice { get; set; }
        public int MaxPurchaseQty { get; set; }
        public int Number { get; set; }
    }
    public class GetProductListFrontResponse_EventTimeSlotsList
    {
        //public string Id { get; set; }
        //public string EventId { get; set; }
        //public DateTime StartDateTime { get; set; }
        //public DateTime EndDateTime { get; set; }
        public string OpeningTime { get; set; }
        public string ClosingTime { get; set; }
    }

    public class AddContactInfoRequest
    {
        /// <summary>
        /// 语言标识
        /// </summary>
        [Required(ErrorMessage = "Language is required")]
        public int lang { set; get; }
        [Required(ErrorMessage = "Sales Point Id is required")]
        public string SalesPointId { get; set; }

        [Required(ErrorMessage = "Last Name is required")]
        public string LastName { get; set; }

        [Required(ErrorMessage = "First Name is required")]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "Contact Number is required")]
        public string ContactNumber { get; set; }

        [Required(ErrorMessage = "Email is required")]
        public string Email { get; set; }
    }

    public class CheckOutProductsRequest
    {
        /// <summary>
        /// 语言标识
        /// </summary>
        [Required(ErrorMessage = "Language is required")]
        public int lang { set; get; }

        [Required(ErrorMessage = "ProductIds is required")]
        public string ProductList { get; set; }
    }
    public class CheckOutProductsRequest_ProductInfo
    {
        public string ProductId { get; set; }
        public string ProductName { get; set; }
        public int ProductNum { get; set; }
    }
    public class CheckOutProductsResponse
    {
        public string ProductId { get; set; }
        public string ProductName { get; set; }
        public int CurrentNum { get; set; }
        /// <summary>
        /// 1: No Qty, 2: Not Found
        /// </summary>
        public int Type { get; set; }
    }

    public class CreateTransactionRequest
    {
        /// <summary>
        /// 语言标识
        /// </summary>
        [Required(ErrorMessage = "Language is required")]
        public int lang { set; get; }

        /// <summary>
        /// TransactionId
        /// </summary>
        [Required(ErrorMessage = "TransactionId is required")]
        public string TransactionId { get; set; }

        [Required(ErrorMessage = "Products is required")]
        public string Products { get; set; }

        [Required(ErrorMessage = "Amount is required")]
        public decimal Amount { get; set; }
    }
    public class CreateTransactionResponse
    {
        public string OrderNo { get; set; }
        public decimal Amount { get; set; }
    }


    public class GetProductEventListResponse
    {
        public List<string>? ProductFieldList { get; set; }
        public List<string>? EventFieldList { get; set; }
    }

    public class GetProductEventListRequest
    {
        public string? ProductField { get; set; }
        public string? EventField { get; set; }
    } 
}
